$('#do-login').on('tap',function(){
	var myForm = collectForm();
    if(checkForm(myForm)){
    	return false;
    }
    jQuery.support.cors = true;
    var httpHost = getHttpHost();
    $.post(httpHost +'login/login', myForm, function (d) {

        if (d.code == 400) {
			login_suc(d);
			mui.back();
        } else {
            mui.toast(d.msg);
        }


    })
});

//得到表单数据
function collectForm(){
	var dataform={};
	dataform.username=$('#account').val();
	dataform.password=$('#password').val();
	return dataform;
}

//表单验证
function checkForm(data) {

    var phone = data.username;
    var mobile_phone2 = /^1[3|4|5|7|8]\d{9}$/;
    if (phone == '' || !mobile_phone2.test(phone)) {
        mui.toast('手机号不正确');
        return true;
    }
    if (data.user_password == '') {
        mui.toast('密码不能为空');
        return true;
    }
}
